package global

import (
	"encoding/json"
	"io"
	"log"
	"os"
)

var AutoLive struct {
	LiveIDs          []int    `json:"LiveIDs"`
	ReplayIDs        []int    `json:"ReplayIDs"`
	BasketballThumbs []string `json:"BasketballThumbs"`
	FootballThumbs   []string `json:"FootballThumbs"`
}

func ReloadAutoLive(filepath string) {
	file, err := os.Open(filepath)

	if err != nil {
		log.Fatal(err)
	}

	defer file.Close()

	buffer, err := io.ReadAll(file)
	if err != nil {
		log.Fatal(err)
	}

	json.Unmarshal(buffer, &AutoLive)
}
